package com.yami.shop.personnft.common.listener;

import com.yami.shop.bean.event.WithdrawalNftUpdateStatusEvent;
import com.yami.shop.common.util.Json;
import com.yami.shop.personnft.common.service.PersonNftApplyService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 确认订单信息时的默认操作
 *
 * @author LGH
 */
@Slf4j
@Component("WithdrawalNftUpdateStatusListener")
@AllArgsConstructor
public class WithdrawalNftUpdateStatusListener {

    @Autowired
    private PersonNftApplyService personNftApplyService;
    /**
     * 购买持仓增加取币记录
     */
    @EventListener(WithdrawalNftUpdateStatusEvent.class)
    public void defaultBusinessAddPersonnListener(WithdrawalNftUpdateStatusEvent event) {
        log.info("修改提现申请表状态,{}", Json.toJsonString(event));
        personNftApplyService.verifyUpdateStaus(event.getApplyId(),null, event.getType(), event.getMsg());
    }
}
